<html>
<head><meta charset="utf-8"><title>expected usage: should we emit the PID to stdout/stderr? · t-compiler/wg-self-profile · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/index.html">t-compiler/wg-self-profile</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html">expected usage: should we emit the PID to stdout/stderr?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="175895652"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175895652" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175895652">(Sep 17 2019 at 11:10)</a>:</h4>
<p>quick question: How are people using this typically observing the PID that the <code>rustc</code> invocation used for its files? I personally ended up making a wrapper script that runs <code>rustc ... &amp;</code> in the background and calls <code>jobs -p; wait</code> so that I can observe it, but I'm wondering if it might make sense for <code>-Z self-profile</code> to print the PID for the user?</p>



<a name="175895789"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175895789" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175895789">(Sep 17 2019 at 11:13)</a>:</h4>
<p>I personally feel like we should think about moving to a scheme where we put the crate name, not the pid, in the file</p>



<a name="175895822"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175895822" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175895822">(Sep 17 2019 at 11:13)</a>:</h4>
<p>or maybe both, I guess, though I personally don't really like having the pid name in the files as it doesn't add much</p>



<a name="175895830"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175895830" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175895830">(Sep 17 2019 at 11:13)</a>:</h4>
<p>or both crate name and pid. Or provide a way for the user to specify file prefix.</p>



<a name="175895978"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175895978" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175895978">(Sep 17 2019 at 11:15)</a>:</h4>
<p>yeah, IIRC problem with file prefix is that a lot of the time there'll be multiple rustc invocations (e.g., with RUSTFLAGS="-Zself-profile" cargo build)</p>



<a name="175896136"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175896136" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175896136">(Sep 17 2019 at 11:17)</a>:</h4>
<p>right. One could attempt to address that with some sort of variable substitution mechanism.</p>



<a name="175896178"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175896178" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175896178">(Sep 17 2019 at 11:18)</a>:</h4>
<p>or just tell users to do that themselves</p>



<a name="175896209"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175896209" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175896209">(Sep 17 2019 at 11:18)</a>:</h4>
<p>I think for the most part I've long really wanted a <code>RUSTFLAGS_CRATE_NAME</code> in Cargo for this sort of thing</p>



<a name="175896219"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175896219" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175896219">(Sep 17 2019 at 11:19)</a>:</h4>
<p>maybe we can have measureme have something that runs atop cargo and sets up a "server" or something and store events into one file from a cargo run</p>



<a name="175896227"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175896227" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175896227">(Sep 17 2019 at 11:19)</a>:</h4>
<p>though that seems more complicated</p>



<a name="175896228"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175896228" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175896228">(Sep 17 2019 at 11:19)</a>:</h4>
<p>... well there is <code>RUSTC_FLAGS=--crate-name _</code>, right?</p>



<a name="175896238"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175896238" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175896238">(Sep 17 2019 at 11:19)</a>:</h4>
<p>but I guess that <code>cargo</code> needs to know about this too</p>



<a name="175896248"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175896248" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175896248">(Sep 17 2019 at 11:19)</a>:</h4>
<p>er, that doesn't really help though right? Since you want it to run for a particular crate, not override crate names for all crates</p>



<a name="175896309"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175896309" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175896309">(Sep 17 2019 at 11:20)</a>:</h4>
<p>currently the best way is <code>cargo build</code> then <code>cargo clean -p &lt;crate&gt;</code> then <code>cargo build</code> if it's the "last" crate</p>



<a name="175896329"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175896329" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175896329">(Sep 17 2019 at 11:20)</a>:</h4>
<p>ah right, you want this to just override the name for the immediate crate being built, not its dependencies, right?</p>



<a name="175896330"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175896330" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175896330">(Sep 17 2019 at 11:20)</a>:</h4>
<p>otherwise that'll not work too well, particularly in today's world where we have builds happening simultaneously cross-crate</p>



<a name="175896352"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175896352" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175896352">(Sep 17 2019 at 11:21)</a>:</h4>
<p>no, no, I want something like <code>RUSTFLAGS_serde="-Zself-profile" RUSTFLAGS_serde_derive="..." cargo build</code></p>



<a name="175896386"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175896386" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175896386">(Sep 17 2019 at 11:21)</a>:</h4>
<p>oh oh oh</p>



<a name="175896445"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175896445" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175896445">(Sep 17 2019 at 11:22)</a>:</h4>
<p><code>RUSTFLAGS_${CRATE_NAME}</code> now I see</p>



<a name="175896458"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175896458" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175896458">(Sep 17 2019 at 11:22)</a>:</h4>
<p>that sounds useful indeed</p>



<a name="175896540"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175896540" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175896540">(Sep 17 2019 at 11:24)</a>:</h4>
<p>It might be a bit painful to support since IIRC we're struggling to get env-parsing in cargo working with matching "parts" (serde vs. serde_derive) but since we know a priori exactly the env variable we expect maybe that's not too bad</p>



<a name="175896553"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175896553" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175896553">(Sep 17 2019 at 11:24)</a>:</h4>
<p>It does seem like a more generally useful feature (certainly, perf wants it, I could imagine e.g. crater runs wanting it)</p>



<a name="175905468"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175905468" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175905468">(Sep 17 2019 at 13:27)</a>:</h4>
<p>Maybe there's a cargo (debugging) feature here as well? If there was a <code>-Z process-info</code> flag you could pass to cargo and have it output a file like:</p>
<div class="codehilite"><pre><span></span>pid      process
9382   rustc --crate-name &quot;serde&quot; ....
122    rustc --crate-name &quot;bin_utils&quot; ....
4983   rustc --crate-name &quot;foo&quot; ....
</pre></div>


<p>that might be useful as well.</p>



<a name="175905630"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175905630" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175905630">(Sep 17 2019 at 13:28)</a>:</h4>
<p>eh, perhaps, but I personally don't like the tying to pids regardless (it seems a bit obscure, and that output could plausibly have the same pid for all three crates, right?)</p>



<a name="175905836"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175905836" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175905836">(Sep 17 2019 at 13:30)</a>:</h4>
<p>At least on Linux and Windows, that seems unlikely</p>



<a name="175905891"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175905891" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175905891">(Sep 17 2019 at 13:31)</a>:</h4>
<p>I'm not sure what macOS does</p>



<a name="175906029"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175906029" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175906029">(Sep 17 2019 at 13:32)</a>:</h4>
<p>Yeah, it does seem unlikely -- I think it circles back during numbering, right? but still, pids are a bit unfriendly from a usability perspective, though they do seem 'state of the art' to an extent (e.g., valgrind also uses them)</p>



<a name="175906124"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175906124" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175906124">(Sep 17 2019 at 13:33)</a>:</h4>
<p>Agreed! I think it would be great to include both the crate name and the pid in the <code>self-profile</code> filename. Usually, crate name should be enough.</p>



<a name="175907394"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175907394" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175907394">(Sep 17 2019 at 13:46)</a>:</h4>
<p>This seemed slightly familiar to me so I tested it on nightly and it appears that try to include the crate name in the output file name already.</p>



<a name="175907449"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175907449" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175907449">(Sep 17 2019 at 13:46)</a>:</h4>
<p>oh yeah, that is true</p>



<a name="175907504"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175907504" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175907504">(Sep 17 2019 at 13:47)</a>:</h4>
<p>my own specific use case was that I wanted to just have a good pattern for <em>knowing</em> what pid was assigned to <code>rustc</code> I just ran</p>



<a name="175907539"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175907539" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175907539">(Sep 17 2019 at 13:47)</a>:</h4>
<p>I think there should be a wrapper tool at some point that handles all of this for you</p>



<a name="175907545"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175907545" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175907545">(Sep 17 2019 at 13:47)</a>:</h4>
<p>If I do <code>RUSTFLAGS="-Z self-profile" cargo build</code> on a fresh checkout of <code>regex</code>, I get this:</p>
<div class="codehilite"><pre><span></span>___-3764.{events,string_data,string_index}
___-5580.{events,string_data,string_index}
___-24468.{events,string_data,string_index}
regex_syntax-11648.{events,string_data,string_index}
regex-32204.{events,string_data,string_index}
</pre></div>



<a name="175907561"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175907561" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175907561">(Sep 17 2019 at 13:47)</a>:</h4>
<p>maybe a cargo subcommand</p>



<a name="175907562"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175907562" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175907562">(Sep 17 2019 at 13:47)</a>:</h4>
<p>I would imagine e.g. that using <code>jobs -p</code> the way I described above is vulnerable to a race with other processes being created</p>



<a name="175907660"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175907660" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175907660">(Sep 17 2019 at 13:48)</a>:</h4>
<p>(in terms of being able to subsequently automatically run <code>measureme</code> without a human attempting to infer the correct PID)</p>



<a name="175907733"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175907733" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175907733">(Sep 17 2019 at 13:49)</a>:</h4>
<p>If we have this info (<a href="https://github.com/rust-lang/measureme/issues/15" target="_blank" title="https://github.com/rust-lang/measureme/issues/15">https://github.com/rust-lang/measureme/issues/15</a>) then such a subcommand could get the header info for all the profile traces in the current directory and offer to process the most recent one.</p>



<a name="175907757"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175907757" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175907757">(Sep 17 2019 at 13:49)</a>:</h4>
<p>Or some other heuristic</p>



<a name="175907914"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175907914" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175907914">(Sep 17 2019 at 13:51)</a>:</h4>
<p>my specific use case is that I'm running the compiler three times: once without incremental, once with incremental with no incrdata, and once with incremental with incrdata. So its important, in that context, for me to have <em>some</em> way of observing the three PIDs that were created.</p>



<a name="175907999"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175907999" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175907999">(Sep 17 2019 at 13:52)</a>:</h4>
<p>Note in particular that in order to get use of the incrdata that was created, it is not ideal to take the approach of using distinct <code>--crate-name</code> for each run</p>



<a name="175908044"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175908044" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175908044">(Sep 17 2019 at 13:52)</a>:</h4>
<p>(I <em>could</em> do it, by including an extra fourth non-self-profiled run to generate the incrdata before the third run I mentioned above)</p>



<a name="175908203"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175908203" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175908203">(Sep 17 2019 at 13:54)</a>:</h4>
<p>Are you invoking <code>rustc</code> directly or going through <code>cargo</code>?</p>



<a name="175908212"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175908212" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175908212">(Sep 17 2019 at 13:54)</a>:</h4>
<p>concrete <a href="https://gist.github.com/a80d060cf360b03bd2f79d4b82933257" target="_blank" title="https://gist.github.com/a80d060cf360b03bd2f79d4b82933257">gist</a> of my wrapper script</p>



<a name="175908231"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175908231" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175908231">(Sep 17 2019 at 13:55)</a>:</h4>
<p>in this case I'm invoking <code>rustc</code> directly</p>



<a name="175908248"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175908248" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175908248">(Sep 17 2019 at 13:55)</a>:</h4>
<p>which is why I am not crazy worried about how I'm using <code>jobs -p</code></p>



<a name="175908250"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175908250" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175908250">(Sep 17 2019 at 13:55)</a>:</h4>
<p>but it still seems suboptimal to me.</p>



<a name="175908258"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175908258" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175908258">(Sep 17 2019 at 13:55)</a>:</h4>
<p>Can you use <code>$!</code>?</p>



<a name="175908272"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175908272" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175908272">(Sep 17 2019 at 13:55)</a>:</h4>
<p><a href="https://unix.stackexchange.com/questions/30370/how-to-get-the-pid-of-the-last-executed-command-in-shell-script" target="_blank" title="https://unix.stackexchange.com/questions/30370/how-to-get-the-pid-of-the-last-executed-command-in-shell-script">https://unix.stackexchange.com/questions/30370/how-to-get-the-pid-of-the-last-executed-command-in-shell-script</a></p>



<a name="175908329"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175908329" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175908329">(Sep 17 2019 at 13:56)</a>:</h4>
<p>I experimented with that but it didn't seem to give me the right number</p>



<a name="175908339"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175908339" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175908339">(Sep 17 2019 at 13:56)</a>:</h4>
<p>it was always off by one or so</p>



<a name="175908347"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175908347" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175908347">(Sep 17 2019 at 13:56)</a>:</h4>
<p>i'm not 100% sure why</p>



<a name="175908355"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175908355" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175908355">(Sep 17 2019 at 13:56)</a>:</h4>
<p>Weird</p>



<a name="175908375"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175908375" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175908375">(Sep 17 2019 at 13:56)</a>:</h4>
<p>it might have been because I was using <code>time</code> in a different way when I was trying to use <code>$!</code></p>



<a name="175908422"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175908422" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175908422">(Sep 17 2019 at 13:57)</a>:</h4>
<p>/me goes to give <code>$!</code> a try again</p>



<a name="175908523"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175908523" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175908523">(Sep 17 2019 at 13:58)</a>:</h4>
<p>It might be a good idea to have <code>rustc</code> print something out anyway when <code>-Z self-profile</code> is turned on. Even a short message would be a good indication that it's running and could include the pid.</p>



<a name="175908600"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175908600" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175908600">(Sep 17 2019 at 13:59)</a>:</h4>
<p>yeah okay <code>echo $!</code> does seem to do the right thing now that I time the <code>wait</code> at the end instead of the initial call...</p>



<a name="175908736"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175908736" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175908736">(Sep 17 2019 at 14:00)</a>:</h4>
<p>(and moving the <code>time</code> to the initial invocation causes the aforementioned off-by-one error)</p>



<a name="175908798"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175908798" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175908798">(Sep 17 2019 at 14:01)</a>:</h4>
<blockquote>
<p>It might be a good idea to have <code>rustc</code> print something out anyway when <code>-Z self-profile</code> is turned on. Even a short message would be a good indication that it's running and could include the pid.</p>
</blockquote>
<p>right, this is what I was wondering about at the outset: Whether there is a good reason <em>not</em> to do this.</p>



<a name="175908865"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/175908865" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#175908865">(Sep 17 2019 at 14:02)</a>:</h4>
<p>I can't think of one.</p>



<a name="176082478"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/176082478" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#176082478">(Sep 19 2019 at 09:32)</a>:</h4>
<p>one reason might be to make the output the same, regardless of whether self-profiling is on or off</p>



<a name="176083713"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/176083713" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#176083713">(Sep 19 2019 at 09:54)</a>:</h4>
<p>okay well maybe I'll add a different <code>-Z</code> flag to make it print the process id. ;)</p>



<a name="176083764"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/expected%20usage%3A%20should%20we%20emit%20the%20PID%20to%20stdout/stderr%3F/near/176083764" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/expected.20usage.3A.20should.20we.20emit.20the.20PID.20to.20stdout.2Fstderr.3F.html#176083764">(Sep 19 2019 at 09:55)</a>:</h4>
<p>(i do appreciate the benefit of keeping stdout/stderr invariant, at least absent other instrumentation like RUSTC_LOG)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>